package eden.api.common.enums;

import lombok.Getter;

@Getter
public enum MemberLevelEnum {

    LEVEL_0(0, "代理商"),
    LEVEL_1(1, "一级"),
    LEVEL_2(2, "二级"),
    LEVEL_3(3, "三级"),
    LEVEL_4(4, "四级"),
    LEVEL_5(5, "五级"),
    LEVEL_6(6, "六级"),
    LEVEL_7(7, "七级"),
    LEVEL_8(8, "八级"),
    LEVEL_9(9, "九级");

    private final Integer code;

    private final String description;

    MemberLevelEnum(Integer code, String description) {
        this.code = code;
        this.description = description;
    }

    public static MemberLevelEnum getPlatLevelEnum(Integer code) {
        for (MemberLevelEnum agentLevelEnum : MemberLevelEnum.values()) {
            if (agentLevelEnum.getCode().equals(code)) {
                return agentLevelEnum;
            }
        }
        return null;
    }


}
